package com.leizi.igym.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @Author: leizi0110
 * @CreateTime: 2024-04-12  09:52
 * @Description: 返回前端分类级联选择器结果集
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(description = "返回前端分类级联选择器结果集")
public class CategoryCascaderVO implements Serializable {

    @Serial
    private static final long serialVersionUID = -7246816815530286866L;

    @Schema(name = "分类对应主键值")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long value;

    @Schema(name = "分类名")
    private String label;

    @Schema(name = "子集")
    private List<CategoryCascaderVO> children;
}
